package com.hp.goods_service.controller;

import com.hp.common_api.entity.SpecGroup;
import com.hp.goods_service.service.ISpecGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SpecGroupController {

    @Autowired
    private ISpecGroupService specGroupService;

    @GetMapping("/specGroups/category/{cid}")
    public ResponseEntity<List<SpecGroup>> getSpecGroupsByCategoryId(@PathVariable Long cid){
        return ResponseEntity.ok(specGroupService.getSpecGroupsByCategoryId(cid));
    }
}
